extends "ActionFather.gd"

func blow(dh,from,to):
	if to.die:
		return null
	var dmg=6
	BaseAction.forward(dh,from)
	BaseAction.wait(dh,0.3)
	HitAnimation.blow(dh,from,to,dmg)
	
func doubleAttack(dh,from,to):
	if to.die:
		return 
	
	var dmg=4
	
	BaseAction.forward(dh,from)
	BaseAction.wait(dh,0.3)
	HitAnimation.sword1(dh,from,to,dmg)
	HitAnimation.sword2(dh,from,to,dmg)
func fire(dh,from,to):
	var dmg=15
	BaseAction.forward(dh,from)
	BaseAction.wait(dh,0.3)
	HitAnimation.fire(dh,from,to,dmg)
func quickAttack(dh,from,to):
	var dmg=3

	BaseAction.forward(dh,from)
	BaseAction.wait(dh,0.3)
	HitAnimation.sword3(dh,from,to,dmg)
	BaseAction.draw()
	
	
func absorb(dh,from,to):
	var dmg=5
	
	BaseAction.forward(dh,from)
	BaseAction.wait(dh,0.3)
	HitAnimation.absorb(dh,from,to,dmg)
	BaseAction.gainEnergy(2)
	BaseAction.discardRandom()
	
#旋风斩
func windSword(dh,from):
	var dmg=10
	var enemys=getEnemys()
	BaseAction.forward(dh,from)
	BaseAction.wait(dh,0.3)
	HitAnimation.windSword(dh,from,enemys,dmg)

#保护
func protect(dh,from,to):
	var armor=8
	
	BaseAction.forward(dh,from)
	BaseAction.wait(dh,0.3)
	BaseAction.gainArmor(dh,to,armor)
	BaseAction.wait(dh,0.2)
	
#壁垒
func barrier(dh,from):
	var armor=10
	var players=getPlayers()
	
	BaseAction.forward(dh,from)
	BaseAction.wait(dh,0.3)
	for player in players:
		BaseAction.gainArmor(dh,player,armor)
	BaseAction.wait(dh,0.2)